/*********************************************************
          File Name:queue.cpp
          Author: Abby Cin
          Mail: abbytsing@gmail.com
          Created Time: Tue 15 Sep 2015 11:08:50 AM CST
**********************************************************/

#include <iostream>
using namespace std;

#include <queue>
#include <string>

int main()
{
        queue<string> q;
        string s;

        while(getline(cin, s))
        {
                q.push(s);
                cin.clear();
        }

        while(!q.empty())
        {
                cout << q.front() << endl;
                q.pop();
        }
        return 0;
}
